﻿using HelloOne.OcelotSvc.Infrastructure;
using HelloOne.OcelotSvc.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.Collections.Generic;

namespace HelloOne.OcelotSvc.ViewModels
{
    public class ReRouteViewModel
    {
        public ReRouteViewModel()
        {
            UpstreamHttpMethod = new List<string>();
            AddHeadersToRequest = new Dictionary<string, string>();
            AddClaimsToRequest = new Dictionary<string, string>();
            RouteClaimsRequirement = new Dictionary<string, string>();
            AddQueriesToRequest = new Dictionary<string, string>();
            DownstreamHeaderTransform = new Dictionary<string, string>();
            FileCacheOptions = new CacheOptions();
            QoSOptions = new QoSOptions();
            RateLimitOptions = new RateLimitRule();
            AuthenticationOptions = new FileAuthenticationOptions();
            HttpHandlerOptions = new HttpHandlerOptions();
            UpstreamHeaderTransform = new Dictionary<string, string>();
            DownstreamHostAndPorts = new List<HostAndPort>();
            DelegatingHandlers = new List<string>();
            Priority = 1;
        }
        public string DownstreamPathTemplate { get; set; }
        public string UpstreamPathTemplate { get; set; }
        public List<string> UpstreamHttpMethod { get; set; }
        public Dictionary<string, string> AddHeadersToRequest { get; set; }
        public Dictionary<string, string> UpstreamHeaderTransform { get; set; }
        public Dictionary<string, string> DownstreamHeaderTransform { get; set; }
        public Dictionary<string, string> AddClaimsToRequest { get; set; }
        public Dictionary<string, string> RouteClaimsRequirement { get; set; }
        public Dictionary<string, string> AddQueriesToRequest { get; set; }
        public string RequestIdKey { get; set; }
        public CacheOptions FileCacheOptions { get; set; }
        public bool ReRouteIsCaseSensitive { get; set; }
        public string ServiceName { get; set; }
        public string DownstreamScheme { get; set; }
        public QoSOptions QoSOptions { get; set; }
        public string LoadBalancer { get; set; }
        public RateLimitRule RateLimitOptions { get; set; }
        public FileAuthenticationOptions AuthenticationOptions { get; set; }
        public HttpHandlerOptions HttpHandlerOptions { get; set; }
        public bool UseServiceDiscovery { get; set; }
        public List<HostAndPort> DownstreamHostAndPorts { get; set; }
        public string UpstreamHost { get; set; }
        public string Key { get; set; }
        public List<string> DelegatingHandlers { get; set; }
        public int Priority { get; set; }
    }
}
